/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dk.eleit.input;

import java.io.*;

/**
 *
 * @author Jeppe
 */
public class SaveLoadManager {
    
    public void save(Object[] data) {
     try {
        FileOutputStream fos = new FileOutputStream("Save");
        ObjectOutputStream out = new ObjectOutputStream(fos);
        out.writeObject(data);
        out.flush();
        out.close();
     }
     catch (IOException e) {
         System.out.println(e); 
     }
  }

  public Object[] load() {
      Object[] data = null;
      try {
        FileInputStream fis = new FileInputStream("Save");
        ObjectInputStream in = new ObjectInputStream(fis);
        data = (Object[])in.readObject();
        in.close();
      }
      catch (Exception e) {
          System.out.println(e);
      }
      return data;
  }
}
